package com.zcxx.cotton.sale;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.zcxx.cotton.sale.domain.BuySaleinfosSub;
import com.zcxx.cotton.sale.service.IBuySaleinfosSubService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.List;



/**
 * 龙门架数据Controller
 *
 * @author ruoyi
 * @date 2025-07-29
 */
@RestController
@RequestMapping("/saleinfos/sub")
public class BuySaleinfosSubController extends BaseController
{
    @Autowired
    private IBuySaleinfosSubService buySaleinfosSubService;

    /**
     * 查询龙门架数据列表
     */
    @GetMapping("/list")
    public TableDataInfo list(BuySaleinfosSub buySaleinfosSub)
    {
        startPage();
        List<BuySaleinfosSub> list = buySaleinfosSubService.selectBuySaleinfosSubList(buySaleinfosSub);
        return getDataTable(list);
    }



    /**
     * 导出龙门架数据列表
     */
    @PostMapping("/export")
    public void export(HttpServletResponse response, BuySaleinfosSub buySaleinfosSub)
    {
        List<BuySaleinfosSub> list = buySaleinfosSubService.selectBuySaleinfosSubList(buySaleinfosSub);
        ExcelUtil<BuySaleinfosSub> util = new ExcelUtil<BuySaleinfosSub>(BuySaleinfosSub.class);
        util.exportExcel(response, list, "龙门架数据数据");
    }


}
